跳跃游戏（medium): https://leetcode.cn/problems/jump-game/description/?envType=study-plan-v2&envId=top-interview-150
class Solution {
public:
    bool canJump(vector<int>& nums) {
        int maxReach=0;
        for(int i=0;i<nums.size();i++)
        {
            if(maxReach<i)
                return false;
            maxReach=max(maxReach,i+nums[i]);
            if(maxReach>=nums.size()-1)
                return true;
        }
        return false;
    }
};